package com.gzdh.dishrecognition.config;

import android.os.Parcel;
import android.os.Parcelable;

import java.io.Serializable;

public class SystemSettingObject implements Serializable, Parcelable {

    private static final long serialVersionUID = -3685176029972330513L;

    private String cameraId;

    private String faceCameraId;

    private int width;

    private int height;
    private Boolean jbLigit = false;
    private int jbLightBar = 0;
    private float zoomLevel = 1f;

    private int compress = 70;

    private int interval = 10;

    private float minimum;

    private int plate = 1;

    private float discount = 1f;

    private int scale = 2;

    private int round;

    private boolean accountsConfirm;

    private boolean printAuto;

    private boolean print;

    private boolean openface;

    private boolean mainFace;

    private boolean other;

    private boolean faceConfirm;

    private boolean soundTips;

    private boolean cash;

    private boolean rollback;

    private boolean x_reverse;

    private boolean y_reverse;

    private boolean ox_reverse;

    private boolean oy_reverse;

    private boolean aloneCard;

    public SystemSettingObject() {
    }

    protected SystemSettingObject(Parcel in) {
        cameraId = in.readString();
        faceCameraId = in.readString();
        width = in.readInt();
        height = in.readInt();
        jbLightBar = in.readInt();
        zoomLevel = in.readFloat();
        compress = in.readInt();
        interval = in.readInt();
        minimum = in.readFloat();
        plate = in.readInt();
        discount = in.readFloat();
        scale = in.readInt();
        round = in.readInt();
        accountsConfirm = in.readByte() != 0;
        printAuto = in.readByte() != 0;
        print = in.readByte() != 0;
        openface = in.readByte() != 0;
        mainFace = in.readByte() != 0;
        other = in.readByte() != 0;
        faceConfirm = in.readByte() != 0;
        soundTips = in.readByte() != 0;
        cash = in.readByte() != 0;
        jbLigit = in.readByte()!=0;
        rollback = in.readByte() != 0;
        x_reverse = in.readByte() != 0;
        y_reverse = in.readByte() != 0;
        ox_reverse = in.readByte() != 0;
        oy_reverse = in.readByte() != 0;
        aloneCard = in.readByte() != 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(cameraId);
        dest.writeString(faceCameraId);
        dest.writeInt(width);
        dest.writeInt(height);
        dest.writeFloat(zoomLevel);
        dest.writeInt(compress);
        dest.writeInt(interval);
        dest.writeFloat(minimum);
        dest.writeInt(plate);
        dest.writeFloat(discount);
        dest.writeInt(scale);
        dest.writeInt(round);
        dest.writeInt(jbLightBar);
        dest.writeByte((byte) (jbLigit ? 1 : 0));
        dest.writeByte((byte) (accountsConfirm ? 1 : 0));
        dest.writeByte((byte) (printAuto ? 1 : 0));
        dest.writeByte((byte) (print ? 1 : 0));
        dest.writeByte((byte) (openface ? 1 : 0));
        dest.writeByte((byte) (mainFace ? 1 : 0));
        dest.writeByte((byte) (other ? 1 : 0));
        dest.writeByte((byte) (faceConfirm ? 1 : 0));
        dest.writeByte((byte) (soundTips ? 1 : 0));
        dest.writeByte((byte) (cash ? 1 : 0));
        dest.writeByte((byte) (rollback ? 1 : 0));
        dest.writeByte((byte) (x_reverse ? 1 : 0));
        dest.writeByte((byte) (y_reverse ? 1 : 0));
        dest.writeByte((byte) (ox_reverse ? 1 : 0));
        dest.writeByte((byte) (oy_reverse ? 1 : 0));
        dest.writeByte((byte) (aloneCard ? 1 : 0));
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<SystemSettingObject> CREATOR = new Creator<SystemSettingObject>() {
        @Override
        public SystemSettingObject createFromParcel(Parcel in) {
            return new SystemSettingObject(in);
        }

        @Override
        public SystemSettingObject[] newArray(int size) {
            return new SystemSettingObject[size];
        }
    };

    public int getJbLightBar() {
        return jbLightBar;
    }

    public void setJbLightBar(int jbLightBar) {
        this.jbLightBar = jbLightBar;
    }

    public Boolean getJbLigit() {
        return jbLigit;
    }

    public void setJbLigit(Boolean jbLigit) {
        this.jbLigit = jbLigit;
    }

    public String getCameraId() {
        return cameraId;
    }

    public void setCameraId(String cameraId) {
        this.cameraId = cameraId;
    }

    public String getFaceCameraId() {
        return faceCameraId;
    }

    public void setFaceCameraId(String faceCameraId) {
        this.faceCameraId = faceCameraId;
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    public float getZoomLevel() {
        return zoomLevel;
    }

    public void setZoomLevel(float zoomLevel) {
        this.zoomLevel = zoomLevel;
    }

    public int getCompress() {
        return compress;
    }

    public void setCompress(int compress) {
        this.compress = compress;
    }

    public int getInterval() {
        return interval;
    }

    public void setInterval(int interval) {
        this.interval = interval;
    }

    public int getPlate() {
        return plate;
    }

    public void setPlate(int plate) {
        this.plate = plate;
    }

    public float getDiscount() {
        return discount;
    }

    public void setDiscount(float discount) {
        this.discount = discount;
    }

    public int getScale() {
        return scale;
    }

    public void setScale(int scale) {
        this.scale = scale;
    }

    public int getRound() {
        return round;
    }

    public void setRound(int round) {
        this.round = round;
    }

    public boolean isAccountsConfirm() {
        return accountsConfirm;
    }

    public void setAccountsConfirm(boolean accountsConfirm) {
        this.accountsConfirm = accountsConfirm;
    }

    public boolean isPrintAuto() {
        return printAuto;
    }

    public void setPrintAuto(boolean printAuto) {
        this.printAuto = printAuto;
    }

    public boolean isOpenface() {
        return openface;
    }

    public void setOpenface(boolean openface) {
        this.openface = openface;
    }

    public boolean isPrint() {
        return print;
    }

    public void setPrint(boolean print) {
        this.print = print;
    }

    public boolean isOther() {
        return other;
    }

    public void setOther(boolean other) {
        this.other = other;
    }

    public boolean isMainFace() {
        return mainFace;
    }

    public void setMainFace(boolean mainFace) {
        this.mainFace = mainFace;
    }

    public boolean isFaceConfirm() {
        return faceConfirm;
    }

    public void setFaceConfirm(boolean faceConfirm) {
        this.faceConfirm = faceConfirm;
    }

    public boolean isSoundTips() {
        return soundTips;
    }

    public void setSoundTips(boolean soundTips) {
        this.soundTips = soundTips;
    }

    public boolean isCash() {
        return cash;
    }

    public void setCash(boolean cash) {
        this.cash = cash;
    }

    public boolean isRollback() {
        return rollback;
    }

    public void setRollback(boolean rollback) {
        this.rollback = rollback;
    }

    public boolean isX_reverse() {
        return x_reverse;
    }

    public void setX_reverse(boolean x_reverse) {
        this.x_reverse = x_reverse;
    }

    public boolean isY_reverse() {
        return y_reverse;
    }

    public void setY_reverse(boolean y_reverse) {
        this.y_reverse = y_reverse;
    }

    public boolean isOx_reverse() {
        return ox_reverse;
    }

    public void setOx_reverse(boolean ox_reverse) {
        this.ox_reverse = ox_reverse;
    }

    public boolean isOy_reverse() {
        return oy_reverse;
    }

    public void setOy_reverse(boolean oy_reverse) {
        this.oy_reverse = oy_reverse;
    }

    public float getMinimum() {
        return minimum;
    }

    public void setMinimum(float minimum) {
        this.minimum = minimum;
    }

    public boolean isAloneCard() {
        return aloneCard;
    }

    public void setAloneCard(boolean aloneCard) {
        this.aloneCard = aloneCard;
    }

    @Override
    public String toString() {
        return "SystemSettingObject{" +
                "cameraId='" + cameraId + '\'' +
                ", faceCameraId='" + faceCameraId + '\'' +
                ", width=" + width +
                ", height=" + height +
                ", jbLigit=" + jbLigit +
                ", zoomLevel=" + zoomLevel +
                ", compress=" + compress +
                ", interval=" + interval +
                ", minimum=" + minimum +
                ", plate=" + plate +
                ", discount=" + discount +
                ", scale=" + scale +
                ", round=" + round +
                ", accountsConfirm=" + accountsConfirm +
                ", printAuto=" + printAuto +
                ", print=" + print +
                ", openface=" + openface +
                ", mainFace=" + mainFace +
                ", other=" + other +
                ", faceConfirm=" + faceConfirm +
                ", soundTips=" + soundTips +
                ", cash=" + cash +
                ", rollback=" + rollback +
                ", x_reverse=" + x_reverse +
                ", y_reverse=" + y_reverse +
                ", ox_reverse=" + ox_reverse +
                ", oy_reverse=" + oy_reverse +
                ", aloneCard=" + aloneCard +
                '}';
    }
}
